export default function request(options) {
  const baseUrl = 'http://nllcoder.com:8028/api/public/v1'
  wx.showLoading({
    title: 'Loading...',
    mask: true
  })
  return new Promise((resolve, reject) => {
    wx.request({
      ...options,
      url: baseUrl + options.url,
      success(result) {
        resolve(result.data.message)
      },
      fail(err) {
        reject(err)
      },
      complete() {
        wx.hideLoading()
      }
    })
  })
}